<?php

namespace Crc\Entity\Repository;

use Doctrine\ORM\EntityRepository,
    Crc\Entity\WaterType;

/**
 * WaterTypeRepository
 *
 */
class WaterTypeRepository extends EntityRepository
{
    public function saveStand(WaterType $waterType, array $values)
    {
        $waterType->setName($values['name']);
        $waterType->setSortOrder($values['sort_order']);
        $this->getEntityManager()->persist($waterType);
    }

    public function removeStand($id)
    {
        $em    = $this->getEntityManager();
        $proxy = $em->getReference('\Crc\Entity\WaterType', $id);
        $em->remove($proxy);
    }
}